from tkinter import*
root = Tk()
root.title('ит марафон по програмированию')
root.geometry('500x500')
canvas = Canvas(bg='white', width =500, height = 500)
canvas.pack(anchor = CENTER, expand = 1)
print('Введите сдвиг по оси x')
x = int(input())
print('Введите сдвиг по оси y')
y = int(input())
print('Введите коэффициент увеличения')
n = int(input())
if n>=0 and 0*n+x>=0 and 0*n+y>=0 and 30*n+x<=500 and 20*n+y<=500:
 x1,y1=0*n+x,0*n+y
 x2,y2=10*n+x,0*n+y 
 x3,y3=10*n+x,10*n+y
 x4,y4=20*n+x,10*n+y
 x5,y5=20*n+x,0*n+y
 x6,y6=30*n+x,0*n+y
 x7,y7=30*n+x,20*n+y
 x8,y8=0*n+x,20*n+y
 canvas.create_polygon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
elif n<0 and 0*abs(n)+x>=0 and 0*abs(n)+y>=0 and 30*abs(n)+x<=500 and 30*abs(n)+y<=500:
 n=-n
 x1,y1=0*n+x,0*n+y
 x2,y2=10*n+x,0*n+y 
 x3,y3=10*n+x,10*n+y
 x4,y4=20*n+x,10*n+y
 x5,y5=20*n+x,0*n+y
 x6,y6=30*n+x,0*n+y
 x7,y7=30*n+x,20*n+y
 x8,y8=0*n+x,20*n+y
 canvas.create_polygon(x1,y1,x2,y2,x3,y3,x4,y4,x5,y5,x6,y6,x7,y7,x8,y8)
else:
    print('Размер фигуры превышает максимальный размер поля')
root.mainloop()    
